<template>
    <XPTable ref='tableRef' :api='pageApi' :columns='columns'>
        <template #search>
            <router-link to='/strategy/stockSelector/'>
                <a-button type='primary'>新 增</a-button>
            </router-link>
        </template>
        <template #name='{record}'>
            <router-link :to='"/strategy/combinationBackTest/" + record.id'>{{record.name}}</router-link>
        </template>
        <template #status='{record}'>
            <a-tag>{{record.status_text}}</a-tag>
            <!-- <XBackTestStatus :status='record.status' /> -->
        </template>
    </XPTable>
</template>

<script lang='ts' setup>
    import { reactive, ref } from 'vue'
    import { combinationBackTestPageApi } from '@/api/combinationBackTest'
    import { Column } from '../../../types'
    async function pageApi(params:any) {
        return combinationBackTestPageApi(params)
    }

    const columns = reactive<Column[]>([
        {title : '名称', dataIndex : 'name', align : 'center', inFilter : true, filter : {name : 'keyword'}},
        {title : '创建时间', dataIndex : 'create_at', align : 'center'},
        {title : '状态', dataIndex : 'status', align : 'center'},
    ])
</script>
